#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# pip3 install PyJWT
# import jwt
import time
import requests
from http.client import HTTPConnection
HTTPConnection.debuglevel=1

# http_header = {
    # "Authorization": f"Bearer {token}",
# }
# print(http_header)
# http_header = f "Bearer {token}"
# http_header = f'Bearer [%s]' %token
# r = requests.post(SANDBOX_URL, headers=http_header, verify=False)
# r = requests.post(URL, headers=http_header, verify=False)
# data = {
        # "startDate": int ((time.time() -15 *3600 * 24) *1000),
        # "endDate": int (time.time() *1000),
        # "NotificationType": "DID_RENEW",
# }
# data = {
        # "startDate":1657392000000,
        # "endDate": 1656929003000,
# }
# r = requests.post("https://gm.ztdheros.com:4073/api/google_notify/watcherofrealms/gp", verify=False)
# r = requests.post("https://gm.ztdheros.com:5007/dev_notify/api/google_notify/watcherofrealms/gp", verify=False)
# r = requests.post("http://47.242.20.203:9000/v2/app_config/watcherofrealms/ios", verify=False)
# print(r.text)

# r = requests.post("http://47.242.20.203:9000/v2/app_config/watcherofrealms/ios", verify=False)
http_header = {
        "Content-Type': 'application/json": "application/json",
}
data = {
        "app_id" : "watcherofrealms",
        "channel":"ios",
        "product_id":"test_xcy"
}
# r = requests.post("http://54.167.153.96:8001/api/request_buy", headers=headers, data=json.dumps())
# r = requests.post("http://54.167.153.96:8001/api/upload_receipt", json=data)
r = requests.post("http://pay.funminigame.com:8001/api/upload_receipt", json=data)
print(r.text)

